/*
	QUBE
	Sandra Obermann - QPT 1 - 2012
	fhs33730 - 1110601021
	FH Salzburg - Studiengang MultiMediaTechnolgy
*/

// Include own written header files
#include "../include/BLOCK.h"

// Used namespaces
using namespace ci;
using namespace ci::gl;

// Initialize BLOCK with: block size, block position and a default block color light gray
BLOCK::BLOCK( int blockSize  ) :
	m_BlockSize ( blockSize ),
	m_BlockPosition( ci::Vec3f::zero() ),
	m_BlockColor( ci::Color( 0.90f, 0.90f, 0.90f ) )
{

}

// Destructor for BLOCK element
BLOCK::~BLOCK()
{

}

// returns the position of the current BLOCK
ci::Vec3f BLOCK::getBlockPosition() const
{
	return m_BlockPosition;
}

// draws the BLOCK with the given parameters: color, position and size
void BLOCK::draw()
{
	gl::pushMatrices();
		gl::color( m_BlockColor );
		gl::drawCube( m_BlockPosition, ci::Vec3f( (float)m_BlockSize, (float)m_BlockSize, (float)m_BlockSize ) );
	gl::popMatrices();
}

// sets the BLOCK to the given position
void BLOCK::setBlockPosition( ci::Vec3f position )
{
	m_BlockPosition = position;
}

// sets the BLOCK to the given color
void BLOCK::setBlockColor( ci::ColorA newColor )
{
	m_BlockColor = newColor;
}